#include <iostream>
#include <stdio.h>

using namespace std;

int gcd(int a,int b){
    int c = 0;
    for(int i = 1; i <= min(a,b); i++){
        if((a%i==0) && (b%i==0) && (i>c)){
            c = i;
        }
    }
    return c;
}

int main() {
    int a,b;
    cin >> a >> b;
    int c = gcd(a,b);
    cout << c << endl << a/c*b;
    return 0;
}